//
//  circleDetailListModel.swift
//  OnceNectar
//
//  Created by Zhang Dream on 17/06/2018.
//  Copyright © 2018 com.inwhoop. All rights reserved.
//

import Foundation
import MappingAce
import SwiftyJSON

struct circleDetailListModel:Mapping {
    var browse :String?
    var collected :String?
    var comment :String?
    var favorite :String?
    var id :String?
    var coverImgPath :String?
    var redirectType :String?
    var share :String?
    var title :String?
    var publishTime :String?

    var label:InterestMarkModel?
    var author: circleAuthorModel?
    
}

extension circleDetailListModel{
    mutating func initLabel(dic: [String:Any]) {
        label = InterestMarkModel(fromDic: dic)
    }
    mutating func initAuthorModel(dic: [String:Any]) {
        author = circleAuthorModel(fromDic: dic)
        let json = JSON(dic)
        if (json["grade"].string != nil) {
            author?.initGradeModel(dic: json["grade"].dictionary!)
        }
    }
    
}
